package com.yy.job.core.domain.context;

import java.util.Date;

import com.yy.job.common.enums.JobStatusEnum;
import com.yy.job.core.config.xml.JobStepXmlConfig;
import com.yy.job.core.config.xml.JobXmlConfig;
import com.yy.job.core.domain.JobDomain;
import com.yy.job.core.domain.JobResult;
import com.yy.job.core.domain.JobStepDomain;
import com.yy.job.core.run.process.IJobStepProcess;

/**
 * jobStep容器，上下文
 * 
 * @author eleven.li
 *
 */
public class JobStepContext extends ProcessContext{
	
	private JobContext jobContext;

	private JobStepDomain jobStepDomain;

	private JobStepXmlConfig jobStepXmlConfig;
	
	/**
	 * step处理bean
	 */
	private IJobStepProcess jobStepProcessBean;
	
	/**
	 * 执行结果
	 */
	private JobResult jobResult;

	public JobContext getJobContext() {
		return this.jobContext;
	}

	public void setJobContext(JobContext jobContext) {
		this.jobContext = jobContext;
	}

	public JobStepDomain getJobStepDomain() {
		return jobStepDomain;
	}

	public void setJobStepDomain(JobStepDomain jobStepDomain) {
		this.jobStepDomain = jobStepDomain;
	}

	public JobStepXmlConfig getJobStepXmlConfig() {
		return jobStepXmlConfig;
	}

	public void setJobStepXmlConfig(JobStepXmlConfig jobStepXmlConfig) {
		this.jobStepXmlConfig = jobStepXmlConfig;
	}

	public IJobStepProcess getJobStepProcessBean() {
		return jobStepProcessBean;
	}

	public void setJobStepProcessBean(IJobStepProcess jobStepProcessBean) {
		this.jobStepProcessBean = jobStepProcessBean;
	}

	public JobStepContext(JobContext jobContext, JobStepDomain jobStepDomain, String operator) {
		this.jobContext = jobContext;
		this.jobStepDomain = jobStepDomain;
		this.setOperator(operator);
		this.setExecStartTime(new Date());
	}

	public JobDomain getJob() {
		return this.jobContext.getJobDomain();
	}

	public JobXmlConfig getJobConfig() {
		return this.jobContext.getJobXmlConfig();
	}

	public JobStatusEnum getFinalJobStatus() {
		return this.jobContext.getFinalJobStatus();
	}

	public JobResult getJobResult() {
		return jobResult;
	}

	public void setJobResult(JobResult jobResult) {
		this.jobResult = jobResult;
	}
	
}
